Opening Access Parameter queries

Access Parameter queries can be opened only when you open an Access database via ODBC. Make sure you have an ODBC data source set up for your Access database before attempting this procedure. See Setting up an ODBC data source.

Note:    When you design a Parameter query in Access, you must provide a prompt for the query and specify a data type for the parameter. First, with your query open in Design View in Microsoft Access, enter a prompt in the Criteria cell for the field that will act as a parameter. Then, choose Parameters from the Query menu in Access, and specify a data type for the parameter you just created. Make sure the prompt appears exactly as it does in the Criteria cell. For complete instructions, refer to your Access documentation. If you do not set up your Parameter query correctly, Crystal Reports will not be able to use it.

To open an Access Parameter query
  1. In Crystal Reports, choose Options from the File menu.

    The Options dialog box appears.

  2. Click the Database tab.

  3. Select the Stored Procedures and/or Reprompt user when connecting check box(es).
  4. In addition, you can specify Table name LIKE and Owner LIKE options if you wish.
  5. Click OK to exit the Options dialog box.
  6. Create a new report and choose ODBC as the data source for your Access database.

    Tip:    Choosing ODBC as your data source automatically logs you onto the server.

    If you did not specify a particular Access database file with your Access ODBC data source, the Select Database dialog box appears.

    Note:    If your database requires a user name and password, or any other log on information, a log on dialog box appears.

  7. Locate and select the database that contains the Access Parameter query you want to use and then expand it.

    If you selected the "Reprompt user when connecting" check box in the Options dialog box, the Allow Reporting On dialog box appears. Otherwise, skip to Step 9.

  8. Make sure the Procedures check box is selected and click OK when finished.
  9. Highlight your Parameter query and click Add.

    Tip:    Your Parameter query is found under the Stored Procedures branch of your ODBC data source in the Data Explorer.

    The Enter Parameter Values dialog box appears.

  10. Highlight a parameter in the Parameter Fields list.

    Set to NULL Value is selected by default. If you want to assign a value, clear the Set to NULL Value check box.

  11. Assign a value by typing into the Discrete Value box and then click OK.
  12. Repeat Steps 10 and 11 for each parameter in your Access Parameter query.
  13. On the Data Explorer dialog box, click Close.

    You can change parameter values at any time by choosing Stored Procedure Parameters from the Database menu.

  14. Create your report using the fields in the Parameter query. Only the records that satisfy the parameter values you specified in the Enter Parameter Values dialog box are used in your report.

Note:    You cannot use Access Action queries or Update queries in Crystal Reports. However, you can use Access Select queries and Cross-tab queries.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com